require "stripe"

module PaymentHelper
  include OrderHelper
    
  def newOrderId
    uuid = SecureRandom.hex(10)    
  end
  
  def is_payment_profile_available?
    
  end
  
  def create_payment_profile
    
  end
  
  def make_purchase(userContext, order_id, s_token, cc_masked)     
    prod_id = userContext.get(order_id)
    product = Product.find(prod_id)
    amt = (product.price * 100)
    res = Stripe::Charge.create(
      :amount => amt.to_int,
      :currency => "usd",
      :card => s_token,
      :description => "test charge"
    )    
  end
  
end
